<?php
	include_once '../includes/snminit.php';
	ob_start();
    include_once '../includes/session.php';
	header("Cache-control: private"); 
    include_once '../includes/constants.php';
    include_once '../includes/functions.php';


    $Act=$_GET['Act'];
    if(!empty($_POST['languageid'])) $_SESSION['LANGUAGE'] = $_POST['languageid'];

    $partners=new partners;
    $partners->connection($host,$user,$pass,$db);
    if(!$partners->isAffiliatelogin())
	{
		header('Location: /'.$snmUrl);
		exit;
	}
    $AFFILIATEID = $aid 			= $_SESSION['AFFILIATEID'] ;
    
	$sql_affiliate	="select * from affiliate_pay where pay_affiliateid=$aid  ";
    $ret_affiliate	=mysql_query($sql_affiliate);
    $row_affiliate	=mysql_fetch_object($ret_affiliate);
    $_SESSION['AFFILIATEBALANCE']=$row_affiliate->pay_amount;

    # get currency values
/*
    $currSql = " SELECT * FROM partners_currency, partners_affiliate WHERE affiliate_id = $AFFILIATEID and currency_caption = affiliate_currency";
    $currRet = @mysql_query($currSql);

    if(@mysql_num_rows($currRet)>0){
     	$currRow = @mysql_fetch_object($currRet);
        $currSymbol = stripslashes($currRow->currency_symbol);
        $currValue = stripslashes($currRow->currency_caption);
    }
*/	
	$currency_code  = $default_currency_code;
	$cur_sql = "SELECT * FROM partners_currency WHERE currency_code='$currency_code' ";
	$res_cur = mysql_query($cur_sql);
	if(mysql_num_rows($res_cur) > 0)
	{
		$row_cur = mysql_fetch_object($res_cur);
		$currSymbol = stripslashes($row_cur->currency_symbol);
		$_SESSION['DEFAULTCURRENCYSYMBOL'] = $currSymbol;
		$currValue 	= stripslashes($row_cur->currency_caption);
		$currCode 	= stripslashes($row_cur->currency_code);
	}
	

	$date = date("Y-m-d");  
	$currBalance = $row_affiliate->pay_amount;   
    
	include 'language_include.php'; 

	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" href="<?php echo $snmINSTALLDIR ?>/admin/css/admin.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="main.css"/>
<style type="text/css">
<!--
.tdheader {
	border: 1px solid #999999;
	background-color: #999999;
}
.tdheaderin {
	border-top: 1px none #999999;
	border-right: 1px solid #999999;
	border-bottom: 1px solid #999999;
	border-left: 1px solid #999999;
}
.tdheaderin2 {
	border-top: 1px none #999999;
	border-right: 1px solid #999999;
	border-bottom: 1px solid #999999;
	border-left: 1px none #999999;
}
.style2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #FFFFFF;
	font-weight: bold;
}
.lang {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #000000;
	font-weight: normal;
}
.style3 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #FFFFFF;
}
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #666666;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
a {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #000000;
	font-weight: bold;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
	color: #003399;
}
a:active {
	text-decoration: none;
}
.Ta {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #FFCC66;
	font-weight: bold;
}
.Ta:link {
	text-decoration: none;
}
.Ta:visited {
	text-decoration: none;
}
.Ta:hover {
	text-decoration: underline;
	color: #FFFF33;
}
.Ta:active {
	text-decoration: none;
}
.af {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #000000;
	font-weight: normal;
}
.af:link {
	text-decoration: none;
}
.af:visited {
	text-decoration: none;
}
.af:hover {
	text-decoration: underline;
	color: #333333;
}
.af:active {
	text-decoration: none;
}
.header_bg_white{
	background-image: url(images/white.gif);
}
.header_bg_yellow{
	background-image: url(images/yellow.gif);
}
-->
</style>
<title>ShopnMatch User Panel</title>
</head>

<body>
<div id="pageSurround">
<div id="logo"><a href="<?php echo $snmINSTALLDIR ?>"><?php echo $snmLogo ?></a></div>
<h1>ShopNmatch Affliate Control Panel</h1>
<hr style="clear: both"/>
<?php	
    include 'affiliates_header.php';
?>

<?php
     include "process.php";
?>		

<?php 	 
     include "footer.php";
?>
</div>
</body>
</html>